﻿using Peninsula.DataAccess.POCO;
using Peninsula.Site.Data.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Peninsula.Web.Areas.Backstage.Models.RepairOrder
{
    public class RepairOrderCreateOrEditModel:UpdateModel
    {
        [StringLength(150)]
        [DisplayName("订单标题")]
        public string Name { get; set; }


        [StringLength(200)]
        [DisplayName("损坏描述")]
        public string Description { get; set; }


        [DisplayName("物品损坏图片")]
        public JQueryFileInputModel JQueryFileInputModel { get; set; } = new JQueryFileInputModel() { };

        [DisplayName("维修价格")]
        [Range(0, 10000)]
        public decimal Price { get; set; }

        [DisplayName("订单状态")]
        public OrderStatus Status { get; set; }

        [DisplayName("预约时间")]
        public DateTime? Appointment { get; set; }

        [DisplayName("结束时间")]
        public DateTime? EndTime { get; set; }

        [StringLength(200)]
        [DisplayName("维修人员留言")]
        public string MMessage { get; set; }

        [StringLength(50)]
        [DisplayName("维修类型")]
        public string ItemTypeId { get; set; }

        [ForeignKey("ItemTypeId")]
        public virtual DataAccess.POCO.ItemType ItemType { get; set; }

        [NotMapped]
        public List<SelectListItem> ItemTypes { get; set; }

        [StringLength(50)]
        [DisplayName("所属店面")]
        public string StoreId { get; set; }

        [ForeignKey("StoreId")]
        public virtual DataAccess.POCO.Store Store { get; set; }

        [NotMapped]
        public List<SelectListItem> Stores { get; set; }

        [StringLength(50)]
        [DisplayName("所属维修人员")]
        public string MaintenanceStaffId { get; set; }
        [ForeignKey("MaintenanceStaffId")]
        public virtual Admin MaintenanceStaff { get; set; }
        [NotMapped]
        public List<SelectListItem> MaintenanceStaffs { get; set; }
    }
}